package model

import (
	"time"
)

// DbAccount 数据库账号表
type DbAccount struct {
	Uid          int64     `gorm:"column:id;type:bigint(20);primaryKey"` // uid
	UserName     string    `gorm:"column:username;type:varchar(64);not null"`
	PassWord     string    `gorm:"column:password;type:varchar(64)"`
	HashKey      string    `gorm:"column:hash_key;type:varchar(12)"`
	Platform     int32     `gorm:"column:type;type:int(11);not null"`
	Nickname     string    `gorm:"column:nickname;type:varchar(255)"`       // 昵称
	HeadImageUrl string    `gorm:"column:head_image_url;type:varchar(255)"` // 头像url
	Token        string    `gorm:"column:token;type:varchar(32)"`           // 令牌
	IpAddr       string    `gorm:"column:ip_addr;type:varchar(15)"`         // ip地址
	CreateTime   time.Time `gorm:"column:create_time;type:datetime"`        // 创建时间
	UpdateTime   time.Time `gorm:"column:update_time;type:datetime"`        // 更新时间
}

func (a DbAccount) TableName() string {
	return "customer"
}
